package com.warmheart.core.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/3/20.
 */
public enum DELETED {
	
    DELETED_NO("01", "正常"), DELETED_YES("02", "已删除");

    private static final Map<String, DELETED> map = new HashMap<String, DELETED>();

	static {
		for (DELETED obj : DELETED.values()) {
			map.put(obj.value, obj);
		}
	}

	// 枚举值
	private String value;

	// 描述
	private String desc;

	private DELETED(String value, String desc) {
		this.value = value;
		this.desc = desc;
	}

	public static DELETED fromString(String valueStr, DELETED... defaultEnum) {
		DELETED obj = map.get(valueStr);
		if (obj == null && defaultEnum != null && defaultEnum.length > 0){
			return defaultEnum[0];
		}
		return obj;
	}

	public String getValue() {
		return value;
	}

	public String getDesc() {
		return desc;
	}
}
